

import 'package:flutter/cupertino.dart';

enum RouteMatchType {
  visual,
  nonVisual,
  noMatch,
}

typedef Widget HandlerFunc<T extends Object>(
    BuildContext context,  T? parameters);

enum HandlerType {
  route,
  function,
}


class Handler {
  Handler({this.type = HandlerType.route, this.handlerFunc});
  final HandlerType type;
  final HandlerFunc? handlerFunc;
}


///
class AppRoute {
  String routeName;
  dynamic handler;
  AppRoute(this.routeName, this.handler);
}

///
class RouteMatch {
  RouteMatch(
      {this.matchType = RouteMatchType.noMatch,
        this.route,
        this.errorMessage = "Unable to match route. Please check the logs."});
  final Route<dynamic>? route;
  final RouteMatchType matchType;
  final String errorMessage;
}